home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / A-An / Airport.cpt / Airport1.0 / background_35082.txt < prev    next >
Text File  |  1988-01-04  |  6KB  |  297 lines

  1. -- background: 35082 from stack: in.0
  2. -- bmap block id: 123022
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on openCard
  8.   put empty into field LatLonga
  9. end openCard
  10.  
  11. on calcltlg
  12.   put last word of line 1 of field LatLong into ld
  13.   put ld/60 into ld
  14.   put first word of line 1 of field LatLong into lfw
  15.   if char 1 of lfw = "N" then
  16.     delete char 1 of lfw
  17.     put lfw+ld into lfw
  18.   else
  19.     delete char 1 of lfw
  20.     put lfw+ld into lfw
  21.     put -1*lfw into lfw
  22.   end if
  23.   put lfw into lat
  24.  
  25.   put last word of line 2 of field LatLong into ld
  26.   put ld/60 into ld
  27.   put first word of line 2 of field LatLong into lfw
  28.   if char 1 of lfw = "W" then
  29.     delete char 1 of lfw
  30.     put lfw+ld into lfw
  31.   else
  32.     delete char 1 of lfw
  33.     put lfw+ld into lfw
  34.     put -1*lfw into lfw
  35.   end if
  36.   put lfw into lng
  37.  
  38.   put line 5 of field LatLong into var
  39.   if char 1 of var ="W" then
  40.     delete char 1 of var
  41.   else
  42.     put "-" into char 1 of var
  43.   end if
  44.   put line 3 of field LatLong into mc
  45.   put mc-var into crs
  46.   if crs > 360 then put crs - 360 into crs
  47.   if crs < 0 then put 360 + crs into crs
  48.   put line 4 of field LatLong into d
  49.   put dlat(lat,lng,crs,d) into latn
  50.   put dlong(lat,latn,lng,crs,d) into longn
  51.   put trunc(abs(latn)) into dg
  52.   if length(dg)<2 then put "0" & dg into dg
  53.   if latn<0 then
  54.     put "S" & dg into lt
  55.   else
  56.     put "N" & dg into lt
  57.   end if
  58.   put round((latn-trunc(abs(latn)))*60) into mins
  59.   if length(mins) = 1 then put "0" & mins into mins
  60.   put lt && mins into latn
  61.   put latn into line 1 of field LatLonga
  62.   put trunc(abs(longn)) into dg
  63.   if length(dg)<3 then put "0" & dg into dg
  64.   if length(dg)<3 then put "0" & dg into dg
  65.   if longn<0 then
  66.     put "E" & dg into lt
  67.   else
  68.     put "W" & dg into lt
  69.   end if
  70.   put round((longn-trunc(abs(longn)))*60) into mins
  71.   if length(mins) = 1 then put "0" & mins into mins
  72.   put lt && mins into longn
  73.  
  74.   put longn into line 2 of field LatLonga
  75. end calcltlg
  76.  
  77.  
  78.  
  79.  
  80. -- part 1 (field)
  81. -- low flags: 00
  82. -- high flags: 4000
  83. -- rect: left=108 top=111 right=196 bottom=236
  84. -- title width / last selected line: 0
  85. -- icon id / first selected line: 0 / 0
  86. -- text alignment: 0
  87. -- font id: 3
  88. -- text size: 12
  89. -- style flags: 256
  90. -- line height: 16
  91. -- part name: LatLong
  92.  
  93.  
  94. -- part 2 (field)
  95. -- low flags: 01
  96. -- high flags: 4000
  97. -- rect: left=237 top=111 right=146 bottom=366
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 0
  101. -- font id: 3
  102. -- text size: 12
  103. -- style flags: 256
  104. -- line height: 16
  105. -- part name: LatLonga
  106.  
  107.  
  108. -- part 3 (button)
  109. -- low flags: 00
  110. -- high flags: A004
  111. -- rect: left=253 top=151 right=205 bottom=325
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Calculate
  120. ----- HyperTalk script -----
  121. on mouseUp
  122.   set cursor to 4
  123.   calcltlg
  124. end mouseUp
  125.  
  126.  
  127.  
  128. -- part 5 (button)
  129. -- low flags: 00
  130. -- high flags: 0000
  131. -- rect: left=234 top=268 right=295 bottom=265
  132. -- title width / last selected line: 0
  133. -- icon id / first selected line: 1014 / 1014
  134. -- text alignment: 1
  135. -- font id: 0
  136. -- text size: 12
  137. -- style flags: 0
  138. -- line height: 16
  139. -- part name: Prev
  140. ----- HyperTalk script -----
  141. on mouseUp
  142.   visual effect scroll right
  143.   go to prev card
  144. end mouseUp
  145.  
  146.  
  147.  
  148. -- part 6 (button)
  149. -- low flags: 00
  150. -- high flags: 0000
  151. -- rect: left=266 top=268 right=295 bottom=297
  152. -- title width / last selected line: 0
  153. -- icon id / first selected line: 1013 / 1013
  154. -- text alignment: 1
  155. -- font id: 0
  156. -- text size: 12
  157. -- style flags: 0
  158. -- line height: 16
  159. -- part name: Next
  160. ----- HyperTalk script -----
  161. on mouseUp
  162.   visual effect  scroll left
  163.   go to next card
  164. end mouseUp
  165.  
  166.  
  167.  
  168. -- part 7 (button)
  169. -- low flags: 00
  170. -- high flags: 0000
  171. -- rect: left=423 top=272 right=298 bottom=453
  172. -- title width / last selected line: 0
  173. -- icon id / first selected line: 1012 / 1012
  174. -- text alignment: 1
  175. -- font id: 0
  176. -- text size: 12
  177. -- style flags: 0
  178. -- line height: 16
  179. -- part name: Return
  180. ----- HyperTalk script -----
  181. on mouseUp
  182.   visual effect iris close
  183.   pop card
  184. end mouseUp
  185.  
  186.  
  187.  
  188. -- part 8 (button)
  189. -- low flags: 00
  190. -- high flags: 2004
  191. -- rect: left=444 top=92 right=132 bottom=484
  192. -- title width / last selected line: 0
  193. -- icon id / first selected line: 9965 / 9965
  194. -- text alignment: 1
  195. -- font id: 0
  196. -- text size: 12
  197. -- style flags: 0
  198. -- line height: 16
  199. -- part name: VOR's
  200. ----- HyperTalk script -----
  201. on mouseUp
  202.   push this card
  203.   go to card "fcVor"
  204. end mouseUp
  205.  
  206.  
  207.  
  208. -- part 9 (button)
  209. -- low flags: 00
  210. -- high flags: 8004
  211. -- rect: left=446 top=175 right=212 bottom=485
  212. -- title width / last selected line: 0
  213. -- icon id / first selected line: 0 / 0
  214. -- text alignment: 1
  215. -- font id: 0
  216. -- text size: 12
  217. -- style flags: 0
  218. -- line height: 16
  219. -- part name: Plan
  220. ----- HyperTalk script -----
  221. on mouseUp
  222.   go to card "Nav"
  223. end mouseUp
  224.  
  225.  
  226.  
  227. -- part 10 (button)
  228. -- low flags: 00
  229. -- high flags: A004
  230. -- rect: left=445 top=136 right=171 bottom=484
  231. -- title width / last selected line: 0
  232. -- icon id / first selected line: 0 / 0
  233. -- text alignment: 1
  234. -- font id: 0
  235. -- text size: 12
  236. -- style flags: 0
  237. -- line height: 16
  238. -- part name: Add
  239. ----- HyperTalk script -----
  240. on mouseUp
  241.   put false into ksw
  242.   if line 1 of field LatLonga is not empty then
  243.     put true into ksw
  244.     ask "Name"
  245.     put it into name
  246.     ask "ID"
  247.     put it into id
  248.     ask STATE
  249.     put it into st
  250.     ask FREQUENCY
  251.     put it into freq
  252.     ask ELEVATION
  253.     put it into elev
  254.     put line 1 of field LatLonga into lat
  255.     put line 2 of field LatLonga into lng
  256.     put line 5 of field Latlong into var
  257.   end if
  258.  
  259.   go to last card
  260.  
  261.   doMenu "NEW CARD"
  262.   if ksw then
  263.     put name into line 1 of field AirportData
  264.     put id into line 2 of field AirportData
  265.     put freq into line 4 of field AirportData
  266.     put st into line 3 of field AirportData
  267.     put lat into line 5 of field AirportData
  268.     put lng into line 6 of field AirportData
  269.     put elev into line 7 of field AirportData
  270.     put var into line 8 of field AirportData
  271.   end if
  272.  
  273.   IF ksw is false then type tab
  274. end mouseUp
  275.  
  276.  
  277.  
  278.  
  279.  
  280. -- part 11 (button)
  281. -- low flags: 00
  282. -- high flags: 2004
  283. -- rect: left=443 top=53 right=89 bottom=485
  284. -- title width / last selected line: 0
  285. -- icon id / first selected line: 20913 / 20913
  286. -- text alignment: 1
  287. -- font id: 0
  288. -- text size: 12
  289. -- style flags: 0
  290. -- line height: 16
  291. -- part name: Airprt
  292. ----- HyperTalk script -----
  293. on mouseUp
  294.   go to card "fcAirport"
  295. end mouseUp
  296.  
  297.